﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.AutoMap;
using FluentNHibernate.AutoMap.Alterations;
using SimpleServiceBus.Persistence.Domain.Management.Entities;

namespace SimpleServiceBus.Persistence.NHibernate.Mapping.AutoMapping.Overrides
{
    /// <summary>
    /// Fluent NHibernate doesn't seem to automap Enum's, so this
    /// is  hopefully a temporary workaround to that. A discussion is
    /// here:http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/9a8d85baeec9fee8
    /// </summary>
    public class EndpointMetricTypeOverride : IAutoMappingOverride<EndpointMetricType>
    {
        public void Override(AutoMap<EndpointMetricType> mapping)
        {
            mapping.Map(metric => metric.DataType);
        }
    }
}
